<%@ page import="com.hngc.dao.UserDao" %>
<%@ page import="java.util.List" %>
<%@ page import="com.hngc.dao.entity.User" %><%--
  Created by IntelliJ IDEA.
  User: 30969
  Date: 2024/1/9
  Time: 9:33
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<table class="table table-condensed">
    <table class="table">
    <tr>
        <th class="success">编号</th>
        <th class="warning">姓名</th>
        <th class="active">年龄</th>
        <th class="danger">日期</th>
        <th class="success">操作</th>
    </tr>


    <%
        UserDao userDao = new UserDao();

        List<User> list=userDao.getAllUser();

        for (int i = 0;i<list.size();i++){

    %>
    <tr>
        <td><%=list.get(i).getId()%>
        </td>
        <td><%=list.get(i).getName()%>
        </td>
        <td><%=list.get(i).getAge()%>
        </td>
        <td><%=list.get(i).getHiredate()%>
        </td>
        <td>
            <a href="userUpdate.jsp?id=<%=list.get(i).getId()%>">修改</a>|
            <a href="javascript:if(confirm('确认删除吗?'))window.location='userDel.jsp?id=<%=list.get(i).getId()%>'">删除</a>
        </td>
    </tr>

        <%
            }
        %>

    </table>

   </body>
</html>
